import { createApp } from "vue";
// import "amfe-flexible";
import "./style.css";
import App from "./App.vue";
import router from "@/router";
import ElementPlusX from "vue-element-plus-x";
import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";

const app = createApp(App);

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component);
}

// function setRootFontSize() {
//     const html = document.documentElement;
//     const width = window.innerWidth;
//     // const baseSize = width > 750 ? 75 : ""; // PC 用 75 移动端用 37.5，
//     const baseSize = width > 750 ? 75 : 37.5; // PC 用 75 移动端用 37.5，
//     html.style.fontSize = baseSize + "px";
// }

// window.addEventListener("resize", setRootFontSize);
// window.addEventListener("load", setRootFontSize);

app.use(router).use(ElementPlusX).use(ElementPlus).mount("#app");
